home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 September
/
Macworld (1997-09).dmg
/
Shareware World
/
Utilities
/
Text Processing
/
Alpha
/
Tcl
/
SystemCode
/
emacs.tcl
< prev
next >
Wrap
Text File
|
1996-08-15
|
2KB
|
119 lines
# Emacs-ish bindings.
bind 0x33 <e> backwardDeleteWord
bind 'b' <es> backwardWordSelect
bind '<' <se> beginningOfBuffer
bind 'b' <X> chooseWindowStatus
bind 'l' <X> currentPosition
bind ')' <Xs> endKeyboardMacro
bind '>' <se> endOfBuffer
bind 'x' <Xz> exchangePointAndMark
bind 'w' <Xz> saveAs
bind 'e' <X> executeKeyboardMacro
bind 'f' <Xz> findFile
bind 'f' <es> forwardWordSelect
bind '\ ' <e> oneSpace
bind 'c' <z> prefixChar
bind 'x' <z> prefixChar
bind 'r' <e> repeatSearchBackward
bind 's' <e> repeatSearchForward
bind 's' <Xz> save
bind '(' <sX> startKeyboardMacro
bind 'o' <X> otherThing
bind '1' <X> zoom
bind 'k' <X> killWindowStatus
bind 'u' <X> upcaseWord
proc emacsMenu {} {
global useEmacs
if {$useEmacs} {
menu -n emacs {
"/F<BforwardChar"
"/B<BbackwardChar"
"/D<BdeleteChar"
"/N<BnextLine"
"/P<BpreviousLine"
"(-"
"/F<IforwardWord"
"/B<IbackwardWord"
"/D<IdeleteWord"
"/v<IdeleteWord"
"/H<IbackwardDeleteWord"
"/u<IbackwardDeleteWord"
"(-"
"/K<BkillLine"
"/Y<Byank"
"/A<BbeginningOfLine"
"/E<BendOfLine"
"/O<BopenLine"
"(-"
"/V<BpageForward"
"/V<IpageBack"
"/L<BcenterRedraw"
"(-"
"/ <BsetMark"
"/W<Bcut"
"/W<Icopy"
"(-"
"/C<IcapitalizeWord"
"upcaseWord"
"/L<IdowncaseWord"
"(-"
"/X<Iexecute"
"/U<BiterationCount"
"/G<BabortEm"
"(-"
"disableEmacs"
}
} else {
menu -n emacs { enableEmacs }
}
}
emacsMenu
proc disableEmacs {} {
global useEmacs modifiedVars
lappend modifiedVars useEmacs
set useEmacs 0
emacsMenu
}
proc enableEmacs {} {
global useEmacs modifiedVars
lappend modifiedVars useEmacs
set useEmacs 1
emacsMenu
}
bind 'f' <e> forwardWord
bind 'b' <e> backwardWord
bind 'd' <e> deleteWord
bind 'h' <e> backwardDeleteWord
bind 'v' <e> pageBack
bind 'w' <e> copy
bind 'g' <e> gotoLine
bind 'e' <e> nextSentence
bind 'a' <e> prevSentence
bind 'c' <e> capitalizeWord
bind 'u' <e> upcaseWord
bind 'l' <e> downcaseWord
bind 'x' <e> execute
bind 0x31 <e> oneSpace
bind 0x31 <o> oneSpace
proc killRegion {} {
set from [getMark]
set to [getPos]
if {$to < $from} {
deleteText $to $from
} else {
deleteText $from $to
}
}
bind 'd' <X> killRegion